Telegram Group & Telegram Channel
This media is not supported in your browser
VIEW IN TELEGRAM
๐Š-๐Œ๐ž๐š๐ง๐ฌ ๐‚๐ฅ๐ฎ๐ฌ๐ญ๐ž๐ซ๐ข๐ง๐  ๐„๐ฑ๐ฉ๐ฅ๐š๐ข๐ง๐ž๐ - ๐Ÿ๐จ๐ซ ๐›๐ž๐ ๐ข๐ง๐ง๐ž๐ซ๐ฌ

๐–๐ก๐š๐ญ ๐ข๐ฌ ๐Š-๐Œ๐ž๐š๐ง๐ฌ?
Itโ€™s an unsupervised machine learning algorithm that automatically groups your data into K similar clusters without labels. It finds hidden patterns using distance-based similarity.

๐ˆ๐ง๐ญ๐ฎ๐ข๐ญ๐ข๐ฏ๐ž ๐ž๐ฑ๐š๐ฆ๐ฉ๐ฅ๐ž:
You run a mall. Your data has:
โ€บ Age
โ€บ Annual Income
โ€บ Spending Score

K-Means can divide customers into:
โคท Budget Shoppers
โคท Mid-Range Customers
โคท High-End Spenders

๐‡๐จ๐ฐ ๐ข๐ญ ๐ฐ๐จ๐ซ๐ค๐ฌ:
โ‘  Choose the number of clusters K
โ‘ก Randomly initialize K centroids
โ‘ข Assign each point to its nearest centroid
โ‘ฃ Move centroids to the mean of their assigned points
โ‘ค Repeat until centroids donโ€™t move (convergence)

๐Ž๐›๐ฃ๐ž๐œ๐ญ๐ข๐ฏ๐ž:
Minimize the total squared distance between data points and their cluster centroids
๐‰ = ฮฃโ€–๐ฑแตข - ฮผโฑผโ€–ยฒ
Where ๐ฑแตข = data point, ฮผโฑผ = cluster center

๐‡๐จ๐ฐ ๐ญ๐จ ๐ฉ๐ข๐œ๐ค ๐Š:
Use the Elbow Method
โคท Plot K vs. total within-cluster variance
โคท The โ€œelbowโ€ in the curve = ideal number of clusters

๐‚๐จ๐๐ž ๐„๐ฑ๐š๐ฆ๐ฉ๐ฅ๐ž (๐’๐œ๐ข๐ค๐ข๐ญ-๐‹๐ž๐š๐ซ๐ง):

from sklearn.cluster import KMeans
X = [[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]]
model = KMeans(n_clusters=2, random_state=0)
model.fit(X)
print(model.labels_)
print(model.cluster_centers_)


๐๐ž๐ฌ๐ญ ๐”๐ฌ๐ž ๐‚๐š๐ฌ๐ž๐ฌ:
โคท Customer segmentation
โคท Image compression
โคท Market analysis
โคท Social network analysis

๐‹๐ข๐ฆ๐ข๐ญ๐š๐ญ๐ข๐จ๐ง๐ฌ:
โ€บ Sensitive to outliers
โ€บ Requires you to predefine K
โ€บ Works best with spherical clusters

https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A ๐Ÿ“ฑ
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/CodeProgrammer/3768
Create:
Last Update:

๐Š-๐Œ๐ž๐š๐ง๐ฌ ๐‚๐ฅ๐ฎ๐ฌ๐ญ๐ž๐ซ๐ข๐ง๐  ๐„๐ฑ๐ฉ๐ฅ๐š๐ข๐ง๐ž๐ - ๐Ÿ๐จ๐ซ ๐›๐ž๐ ๐ข๐ง๐ง๐ž๐ซ๐ฌ

๐–๐ก๐š๐ญ ๐ข๐ฌ ๐Š-๐Œ๐ž๐š๐ง๐ฌ?
Itโ€™s an unsupervised machine learning algorithm that automatically groups your data into K similar clusters without labels. It finds hidden patterns using distance-based similarity.

๐ˆ๐ง๐ญ๐ฎ๐ข๐ญ๐ข๐ฏ๐ž ๐ž๐ฑ๐š๐ฆ๐ฉ๐ฅ๐ž:
You run a mall. Your data has:
โ€บ Age
โ€บ Annual Income
โ€บ Spending Score

K-Means can divide customers into:
โคท Budget Shoppers
โคท Mid-Range Customers
โคท High-End Spenders

๐‡๐จ๐ฐ ๐ข๐ญ ๐ฐ๐จ๐ซ๐ค๐ฌ:
โ‘  Choose the number of clusters K
โ‘ก Randomly initialize K centroids
โ‘ข Assign each point to its nearest centroid
โ‘ฃ Move centroids to the mean of their assigned points
โ‘ค Repeat until centroids donโ€™t move (convergence)

๐Ž๐›๐ฃ๐ž๐œ๐ญ๐ข๐ฏ๐ž:
Minimize the total squared distance between data points and their cluster centroids
๐‰ = ฮฃโ€–๐ฑแตข - ฮผโฑผโ€–ยฒ
Where ๐ฑแตข = data point, ฮผโฑผ = cluster center

๐‡๐จ๐ฐ ๐ญ๐จ ๐ฉ๐ข๐œ๐ค ๐Š:
Use the Elbow Method
โคท Plot K vs. total within-cluster variance
โคท The โ€œelbowโ€ in the curve = ideal number of clusters

๐‚๐จ๐๐ž ๐„๐ฑ๐š๐ฆ๐ฉ๐ฅ๐ž (๐’๐œ๐ข๐ค๐ข๐ญ-๐‹๐ž๐š๐ซ๐ง):

from sklearn.cluster import KMeans
X = [[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]]
model = KMeans(n_clusters=2, random_state=0)
model.fit(X)
print(model.labels_)
print(model.cluster_centers_)


๐๐ž๐ฌ๐ญ ๐”๐ฌ๐ž ๐‚๐š๐ฌ๐ž๐ฌ:
โคท Customer segmentation
โคท Image compression
โคท Market analysis
โคท Social network analysis

๐‹๐ข๐ฆ๐ข๐ญ๐š๐ญ๐ข๐จ๐ง๐ฌ:
โ€บ Sensitive to outliers
โ€บ Requires you to predefine K
โ€บ Works best with spherical clusters

https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A ๐Ÿ“ฑ

BY Python | Machine Learning | Coding | R


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/CodeProgrammer/3768

View MORE
Open in Telegram


Python | Machine Learning | Coding | R Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Python | Machine Learning | Coding | R from nl


Telegram Python | Machine Learning | Coding | R
FROM USA